<h3 class="spatitle">全部商品</h3>
<div class="kuang2">
  <p style="margin-left: 20px">产品</p> 
  <p style="margin-left: 410px">单价</p> 
  <p style="margin-left: 125px">数量</p>
  <p style="margin-left: 133px">实付款</p>
  <p style="margin-left: 133px">操作</p>
</div>

<foreach name="cartList" item="v" key="k" >
  <div class="cpk">
    <div class="checkk <if condition="$v[selected] eq 1" >gou1</if>">
      <input type="hidden" name="cart_select[{$v.id}]" <if condition="$v[selected] eq 1" >value="1"</if>>
    </div>
    <img class="spimg" src="{$v.goods_id|goods_thum_images=83,83}" alt="">
    <a href=""><p class="sptitle">{$v.goods_name}</p></a>
    <span class="spzs">{$v.goods_remark|getSubstr=0,100}</span>
    <h3 class="spprice">￥<span class="cr">{$v.member_goods_price}</span></h3>
    <p class="spprice1">￥{$v.goods_price}</p>
    <div class="nb">
      <div class="jian ftl" onclick="switch_num(-1,{$v.id},{$v.store_count});">-</div>
      <input type="text" class="number ftl" id="goods_num[{$v.id}]" readonly="" value="{$v.goods_num}" name="goods_num[{$v.id}]">
      <div class="jia ftl" onclick="switch_num(1,{$v.id},{$v.store_count});">+</div>
    </div>
    <h3 class="allprice">￥<span class="dr">{$v.goods_fee}</span></h3>
    <!-- <span class="yf">（含运费￥5.00）</span> -->
    <p class="dffqxdd" onclick="if(confirm('确定要删除吗?')) ajax_del_cart({$v.id});">删除</p>
  </div>
</foreach>

<div class="jsa">
  <div class="qxa <if condition="$select_all eq 1" >gou2</if>">
    <input type="hidden" name="select_all" <if condition="$select_all eq 1" >value="1"</if>>
  </div>
  <div class="qx">全选</div>
  <div class="sc" onclick="del_cart_more();">删除</div>
  <div class="yxsp">已选商品<span>{$total_price.num}</span>件</div>
  <a href="{:U('Home/Cart/cart2')}"><div class="jsl ftr">结算</div></a>
  <div class="heji ftr">合计（不含运费）：<span>{$total_price.total_fee }</span></div>
</div>

<script type="text/javascript">
  // 选择按钮
  $(".checkk").click(function(){
    if($(this).hasClass("gou1")){
      $(this).removeClass("gou1");
      $(".qxa").removeClass("gou2");
      $(this).children('input').val(0);
      $(".qxa").children('input').val(0);
    }else{
      $(this).addClass("gou1");
      $(this).children('input').val(1);
    }
    ajax_cart_list();
  });

  // 全选按钮
  $(".qxa, .qx").click(function(){
    if($('.qxa').hasClass("gou2")){
      $(".checkk").removeClass("gou1");
      $(".qxa").removeClass("gou2");
      $(".qxa, .checkk").children('input').val(0);
    }else{
      $(".checkk").addClass("gou1");
      $(".qxa").addClass("gou2");
      $(".qxa, .checkk").children('input').val(1);
    }
    ajax_cart_list();
  });
</script>